3.177 \(\int \frac{(h+i x)^2 (a+b \log (c (e+f x)))}{d e+d f x} \, dx\)

Optimal. Leaf size=157 \[ \frac{(f h-e i)^2 \log (e+f x) (a+b \log (c (e+f x)))}{d f^3}+\frac{2 i (e+f x) (f h-e i) (a+b \log (c (e+f x)))}{d f^3}+\frac{i^2 (e+f x)^2 (a+b \log (c (e+f x)))}{2 d f^3}-\frac{b (-3 e i+4 f h+f i x)^2}{4 d f^3}-\frac{b (f h-e i)^2 \log ^2(e+f x)}{2 d f^3} \]

[Out]

-(b*(4*f*h - 3*e*i + f*i*x)^2)/(4*d*f^3) - (b*(f*h - e*i)^2*Log[e + f*x]^2)/(2*d*f^3) + (2*i*(f*h - e*i)*(e +
f*x)*(a + b*Log[c*(e + f*x)]))/(d*f^3) + (i^2*(e + f*x)^2*(a + b*Log[c*(e + f*x)]))/(2*d*f^3) + ((f*h - e*i)^2
*Log[e + f*x]*(a + b*Log[c*(e + f*x)]))/(d*f^3)

________________________________________________________________________________________

Rubi [A]  time = 0.262926, antiderivative size = 133, normalized size of antiderivative = 0.85, number of steps used = 7, number of rules used = 6, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {2411, 12, 43, 2334, 14, 2301} \[ \frac{\left (\frac{4 i (e+f x) (f h-e i)}{f^2}+\frac{2 (f h-e i)^2 \log (e+f x)}{f^2}+\frac{i^2 (e+f x)^2}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac{b (-3 e i+4 f h+f i x)^2}{4 d f^3}-\frac{b (f h-e i)^2 \log ^2(e+f x)}{2 d f^3} \]

Antiderivative was successfully verified.

[In]

Int[((h + i*x)^2*(a + b*Log[c*(e + f*x)]))/(d*e + d*f*x),x]

[Out]

-(b*(4*f*h - 3*e*i + f*i*x)^2)/(4*d*f^3) - (b*(f*h - e*i)^2*Log[e + f*x]^2)/(2*d*f^3) + (((4*i*(f*h - e*i)*(e
+ f*x))/f^2 + (i^2*(e + f*x)^2)/f^2 + (2*(f*h - e*i)^2*Log[e + f*x])/f^2)*(a + b*Log[c*(e + f*x)]))/(2*d*f)

Rule 2411

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((g*x)/e)^q*((e*h - d*i)/e + (i*x)/e)^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rubi steps

\begin{align*} \int \frac{(h+177 x)^2 (a+b \log (c (e+f x)))}{d e+d f x} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (\frac{-177 e+f h}{f}+\frac{177 x}{f}\right )^2 (a+b \log (c x))}{d x} \, dx,x,e+f x\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{\left (\frac{-177 e+f h}{f}+\frac{177 x}{f}\right )^2 (a+b \log (c x))}{x} \, dx,x,e+f x\right )}{d f}\\ &=-\frac{\left (\frac{708 (177 e-f h) (e+f x)}{f^2}-\frac{31329 (e+f x)^2}{f^2}-\frac{2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac{b \operatorname{Subst}\left (\int \frac{-177 (708 e-4 f h-177 x) x+2 (-177 e+f h)^2 \log (x)}{2 f^2 x} \, dx,x,e+f x\right )}{d f}\\ &=-\frac{\left (\frac{708 (177 e-f h) (e+f x)}{f^2}-\frac{31329 (e+f x)^2}{f^2}-\frac{2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac{b \operatorname{Subst}\left (\int \frac{-177 (708 e-4 f h-177 x) x+2 (-177 e+f h)^2 \log (x)}{x} \, dx,x,e+f x\right )}{2 d f^3}\\ &=-\frac{\left (\frac{708 (177 e-f h) (e+f x)}{f^2}-\frac{31329 (e+f x)^2}{f^2}-\frac{2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac{b \operatorname{Subst}\left (\int \left (-177 (708 e-4 f h-177 x)+\frac{2 (177 e-f h)^2 \log (x)}{x}\right ) \, dx,x,e+f x\right )}{2 d f^3}\\ &=-\frac{b (531 e-4 f h-177 f x)^2}{4 d f^3}-\frac{\left (\frac{708 (177 e-f h) (e+f x)}{f^2}-\frac{31329 (e+f x)^2}{f^2}-\frac{2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac{\left (b (177 e-f h)^2\right ) \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,e+f x\right )}{d f^3}\\ &=-\frac{b (531 e-4 f h-177 f x)^2}{4 d f^3}-\frac{b (177 e-f h)^2 \log ^2(e+f x)}{2 d f^3}-\frac{\left (\frac{708 (177 e-f h) (e+f x)}{f^2}-\frac{31329 (e+f x)^2}{f^2}-\frac{2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}\\ \end{align*}

Mathematica [A]  time = 0.146495, size = 214, normalized size = 1.36 \[ \frac{2 a^2 e^2 i^2-4 a^2 e f h i+2 a^2 f^2 h^2+2 b \log (c (e+f x)) \left (2 a (f h-e i)^2+b i \left (-2 e^2 i+e f (4 h-2 i x)+f^2 x (4 h+i x)\right )\right )-4 a b e f i^2 x+8 a b f^2 h i x+2 a b f^2 i^2 x^2+2 b^2 (f h-e i)^2 \log ^2(c (e+f x))-2 b^2 e^2 i^2 \log (e+f x)+6 b^2 e f i^2 x-8 b^2 f^2 h i x-b^2 f^2 i^2 x^2}{4 b d f^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((h + i*x)^2*(a + b*Log[c*(e + f*x)]))/(d*e + d*f*x),x]

[Out]

(2*a^2*f^2*h^2 - 4*a^2*e*f*h*i + 2*a^2*e^2*i^2 + 8*a*b*f^2*h*i*x - 8*b^2*f^2*h*i*x - 4*a*b*e*f*i^2*x + 6*b^2*e
*f*i^2*x + 2*a*b*f^2*i^2*x^2 - b^2*f^2*i^2*x^2 - 2*b^2*e^2*i^2*Log[e + f*x] + 2*b*(2*a*(f*h - e*i)^2 + b*i*(-2
*e^2*i + e*f*(4*h - 2*i*x) + f^2*x*(4*h + i*x)))*Log[c*(e + f*x)] + 2*b^2*(f*h - e*i)^2*Log[c*(e + f*x)]^2)/(4
*b*d*f^3)

________________________________________________________________________________________

Maple [B]  time = 0.062, size = 387, normalized size = 2.5 \begin{align*} 2\,{\frac{aehi}{d{f}^{2}}}-{\frac{ae{i}^{2}x}{d{f}^{2}}}+2\,{\frac{bhi\ln \left ( cfx+ce \right ) e}{d{f}^{2}}}-{\frac{be{i}^{2}\ln \left ( cfx+ce \right ) x}{d{f}^{2}}}-2\,{\frac{aehi\ln \left ( cfx+ce \right ) }{d{f}^{2}}}-{\frac{behi \left ( \ln \left ( cfx+ce \right ) \right ) ^{2}}{d{f}^{2}}}-2\,{\frac{behi}{d{f}^{2}}}+{\frac{a{h}^{2}\ln \left ( cfx+ce \right ) }{df}}+{\frac{b{h}^{2} \left ( \ln \left ( cfx+ce \right ) \right ) ^{2}}{2\,df}}+{\frac{b{i}^{2}\ln \left ( cfx+ce \right ){x}^{2}}{2\,df}}-{\frac{b{i}^{2}{x}^{2}}{4\,df}}+{\frac{a{i}^{2}{x}^{2}}{2\,df}}+{\frac{a{e}^{2}{i}^{2}\ln \left ( cfx+ce \right ) }{d{f}^{3}}}+{\frac{b{e}^{2}{i}^{2} \left ( \ln \left ( cfx+ce \right ) \right ) ^{2}}{2\,d{f}^{3}}}+{\frac{7\,b{e}^{2}{i}^{2}}{4\,d{f}^{3}}}-{\frac{3\,a{e}^{2}{i}^{2}}{2\,d{f}^{3}}}+{\frac{3\,be{i}^{2}x}{2\,d{f}^{2}}}-{\frac{3\,b{e}^{2}{i}^{2}\ln \left ( cfx+ce \right ) }{2\,d{f}^{3}}}-2\,{\frac{bhix}{df}}+2\,{\frac{bhi\ln \left ( cfx+ce \right ) x}{df}}+2\,{\frac{ahix}{df}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((i*x+h)^2*(a+b*ln(c*(f*x+e)))/(d*f*x+d*e),x)

[Out]

2/f^2/d*a*e*h*i-1/f^2/d*a*e*i^2*x+2/f^2/d*b*h*i*ln(c*f*x+c*e)*e-1/f^2/d*b*e*i^2*ln(c*f*x+c*e)*x-2/f^2/d*a*e*h*
i*ln(c*f*x+c*e)-1/f^2/d*b*e*h*i*ln(c*f*x+c*e)^2-2/f^2/d*b*e*h*i+1/f/d*a*h^2*ln(c*f*x+c*e)+1/2/f/d*b*h^2*ln(c*f
*x+c*e)^2+1/2/f/d*b*i^2*ln(c*f*x+c*e)*x^2-1/4/f/d*b*i^2*x^2+1/2/f/d*a*i^2*x^2+1/f^3/d*a*e^2*i^2*ln(c*f*x+c*e)+
1/2/f^3/d*b*e^2*i^2*ln(c*f*x+c*e)^2+7/4/f^3/d*b*e^2*i^2-3/2/f^3/d*a*e^2*i^2+3/2/f^2/d*b*e*i^2*x-3/2/f^3/d*b*e^
2*i^2*ln(c*f*x+c*e)-2/f/d*b*h*i*x+2/f/d*b*h*i*ln(c*f*x+c*e)*x+2/f/d*a*h*i*x

________________________________________________________________________________________

Maxima [B]  time = 1.22592, size = 474, normalized size = 3.02 \begin{align*} 2 \, b h i{\left (\frac{x}{d f} - \frac{e \log \left (f x + e\right )}{d f^{2}}\right )} \log \left (c f x + c e\right ) + \frac{1}{2} \, b i^{2}{\left (\frac{2 \, e^{2} \log \left (f x + e\right )}{d f^{3}} + \frac{f x^{2} - 2 \, e x}{d f^{2}}\right )} \log \left (c f x + c e\right ) - \frac{1}{2} \, b h^{2}{\left (\frac{2 \, \log \left (c f x + c e\right ) \log \left (d f x + d e\right )}{d f} - \frac{\log \left (f x + e\right )^{2} + 2 \, \log \left (f x + e\right ) \log \left (c\right )}{d f}\right )} + 2 \, a h i{\left (\frac{x}{d f} - \frac{e \log \left (f x + e\right )}{d f^{2}}\right )} + \frac{1}{2} \, a i^{2}{\left (\frac{2 \, e^{2} \log \left (f x + e\right )}{d f^{3}} + \frac{f x^{2} - 2 \, e x}{d f^{2}}\right )} + \frac{b h^{2} \log \left (c f x + c e\right ) \log \left (d f x + d e\right )}{d f} + \frac{a h^{2} \log \left (d f x + d e\right )}{d f} + \frac{{\left (e \log \left (f x + e\right )^{2} - 2 \, f x + 2 \, e \log \left (f x + e\right )\right )} b h i}{d f^{2}} - \frac{{\left (f^{2} x^{2} + 2 \, e^{2} \log \left (f x + e\right )^{2} - 6 \, e f x + 6 \, e^{2} \log \left (f x + e\right )\right )} b i^{2}}{4 \, d f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)^2*(a+b*log(c*(f*x+e)))/(d*f*x+d*e),x, algorithm="maxima")

[Out]

2*b*h*i*(x/(d*f) - e*log(f*x + e)/(d*f^2))*log(c*f*x + c*e) + 1/2*b*i^2*(2*e^2*log(f*x + e)/(d*f^3) + (f*x^2 -
 2*e*x)/(d*f^2))*log(c*f*x + c*e) - 1/2*b*h^2*(2*log(c*f*x + c*e)*log(d*f*x + d*e)/(d*f) - (log(f*x + e)^2 + 2
*log(f*x + e)*log(c))/(d*f)) + 2*a*h*i*(x/(d*f) - e*log(f*x + e)/(d*f^2)) + 1/2*a*i^2*(2*e^2*log(f*x + e)/(d*f
^3) + (f*x^2 - 2*e*x)/(d*f^2)) + b*h^2*log(c*f*x + c*e)*log(d*f*x + d*e)/(d*f) + a*h^2*log(d*f*x + d*e)/(d*f)
+ (e*log(f*x + e)^2 - 2*f*x + 2*e*log(f*x + e))*b*h*i/(d*f^2) - 1/4*(f^2*x^2 + 2*e^2*log(f*x + e)^2 - 6*e*f*x
+ 6*e^2*log(f*x + e))*b*i^2/(d*f^3)

________________________________________________________________________________________

Fricas [A]  time = 1.69835, size = 366, normalized size = 2.33 \begin{align*} \frac{{\left (2 \, a - b\right )} f^{2} i^{2} x^{2} + 2 \,{\left (b f^{2} h^{2} - 2 \, b e f h i + b e^{2} i^{2}\right )} \log \left (c f x + c e\right )^{2} + 2 \,{\left (4 \,{\left (a - b\right )} f^{2} h i -{\left (2 \, a - 3 \, b\right )} e f i^{2}\right )} x + 2 \,{\left (b f^{2} i^{2} x^{2} + 2 \, a f^{2} h^{2} - 4 \,{\left (a - b\right )} e f h i +{\left (2 \, a - 3 \, b\right )} e^{2} i^{2} + 2 \,{\left (2 \, b f^{2} h i - b e f i^{2}\right )} x\right )} \log \left (c f x + c e\right )}{4 \, d f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)^2*(a+b*log(c*(f*x+e)))/(d*f*x+d*e),x, algorithm="fricas")

[Out]

1/4*((2*a - b)*f^2*i^2*x^2 + 2*(b*f^2*h^2 - 2*b*e*f*h*i + b*e^2*i^2)*log(c*f*x + c*e)^2 + 2*(4*(a - b)*f^2*h*i
 - (2*a - 3*b)*e*f*i^2)*x + 2*(b*f^2*i^2*x^2 + 2*a*f^2*h^2 - 4*(a - b)*e*f*h*i + (2*a - 3*b)*e^2*i^2 + 2*(2*b*
f^2*h*i - b*e*f*i^2)*x)*log(c*f*x + c*e))/(d*f^3)

________________________________________________________________________________________

Sympy [A]  time = 1.41912, size = 216, normalized size = 1.38 \begin{align*} \frac{x^{2} \left (2 a i^{2} - b i^{2}\right )}{4 d f} - \frac{x \left (2 a e i^{2} - 4 a f h i - 3 b e i^{2} + 4 b f h i\right )}{2 d f^{2}} + \frac{\left (- 2 b e i^{2} x + 4 b f h i x + b f i^{2} x^{2}\right ) \log{\left (c \left (e + f x\right ) \right )}}{2 d f^{2}} + \frac{\left (b e^{2} i^{2} - 2 b e f h i + b f^{2} h^{2}\right ) \log{\left (c \left (e + f x\right ) \right )}^{2}}{2 d f^{3}} + \frac{\left (2 a e^{2} i^{2} - 4 a e f h i + 2 a f^{2} h^{2} - 3 b e^{2} i^{2} + 4 b e f h i\right ) \log{\left (e + f x \right )}}{2 d f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)**2*(a+b*ln(c*(f*x+e)))/(d*f*x+d*e),x)

[Out]

x**2*(2*a*i**2 - b*i**2)/(4*d*f) - x*(2*a*e*i**2 - 4*a*f*h*i - 3*b*e*i**2 + 4*b*f*h*i)/(2*d*f**2) + (-2*b*e*i*
*2*x + 4*b*f*h*i*x + b*f*i**2*x**2)*log(c*(e + f*x))/(2*d*f**2) + (b*e**2*i**2 - 2*b*e*f*h*i + b*f**2*h**2)*lo
g(c*(e + f*x))**2/(2*d*f**3) + (2*a*e**2*i**2 - 4*a*e*f*h*i + 2*a*f**2*h**2 - 3*b*e**2*i**2 + 4*b*e*f*h*i)*log
(e + f*x)/(2*d*f**3)

________________________________________________________________________________________

Giac [A]  time = 1.21063, size = 325, normalized size = 2.07 \begin{align*} \frac{8 \, b f^{2} h i x \log \left (c f x + c e\right ) + 2 \, b f^{2} h^{2} \log \left (c f x + c e\right )^{2} - 4 \, b f h i e \log \left (c f x + c e\right )^{2} + 8 \, a f^{2} h i x - 8 \, b f^{2} h i x - 2 \, b f^{2} x^{2} \log \left (c f x + c e\right ) + 4 \, a f^{2} h^{2} \log \left (f x + e\right ) - 8 \, a f h i e \log \left (f x + e\right ) + 8 \, b f h i e \log \left (f x + e\right ) - 2 \, a f^{2} x^{2} + b f^{2} x^{2} + 4 \, b f x e \log \left (c f x + c e\right ) + 4 \, a f x e - 6 \, b f x e - 2 \, b e^{2} \log \left (c f x + c e\right )^{2} - 4 \, a e^{2} \log \left (f x + e\right ) + 6 \, b e^{2} \log \left (f x + e\right )}{4 \, d f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)^2*(a+b*log(c*(f*x+e)))/(d*f*x+d*e),x, algorithm="giac")

[Out]

1/4*(8*b*f^2*h*i*x*log(c*f*x + c*e) + 2*b*f^2*h^2*log(c*f*x + c*e)^2 - 4*b*f*h*i*e*log(c*f*x + c*e)^2 + 8*a*f^
2*h*i*x - 8*b*f^2*h*i*x - 2*b*f^2*x^2*log(c*f*x + c*e) + 4*a*f^2*h^2*log(f*x + e) - 8*a*f*h*i*e*log(f*x + e) +
 8*b*f*h*i*e*log(f*x + e) - 2*a*f^2*x^2 + b*f^2*x^2 + 4*b*f*x*e*log(c*f*x + c*e) + 4*a*f*x*e - 6*b*f*x*e - 2*b
*e^2*log(c*f*x + c*e)^2 - 4*a*e^2*log(f*x + e) + 6*b*e^2*log(f*x + e))/(d*f^3)